package string

// https://leetcode-cn.com/leetbook/read/top-interview-questions-easy/xn5z8r/
// 第一个不重复的字符
// 算法: 遍历
func firstUniqChar(s string) int {
	occurMap := map[int32]int{}
	for _, currentChar := range s {
		occurMap[currentChar]++
	}
	for index, currentChar := range s {
		if 1 == occurMap[currentChar] {
			return index
		}
	}
	return -1
}
